<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app" v-cloak>
    <p>完整时间：{{date | dateToString}}</p>
    <p>年月日：{{date | dateToString("YYYY-MM-DD")}}</p>
    <p>时分秒：{{date | dateToString("HH:mm:ss")}}</p>
</div>
<script src="./vue/vue.min.js"></script>
<script src="moment-2.24.0.min.js"></script>
<script>
    Vue.filter("dateToString", function (value, format) {
        return moment(value).format( format || "YYYY-MM-DD HH:mm:ss")
    });
    alert("111")
    new Vue({
        el:"#app",
        data: {
            date: new Date(),
            d:""
        },

    })
</script>
</body>
</html>